import http from '@/api/http.js'
export default {
    carmeraUpload(data, cb, error) {
        http.$post('gaoCameraPictureUpload', { data: data }).then(res => {
            cb(res)
        })
    },
    fileUpload(data, cb, error) {
        var param = new FormData()
        param.append('file', data)
        http.$post('fileUpload', { data: param }, { 'Content-Type': 'multipart/form-data', }).then(res => {
            cb(res)
        })
    },
    fileUpdate(data, cb, error) {
        http.$post('fileUpdate', { data: data }).then(res => {
            cb(res)
        })
    },
    fileDownload(data, cb, error) {
        let url = config.httpService + 'zcgl-admin/annex/download?id=' + data.id
        let link = document.createElement('a');
        link.style.display = 'none';
        link.href = url;
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
    },
    fileDownloadPackage(data, cb, error) {
        let url = config.httpService + 'zcgl-admin/annex/downloadPackage?ids=' + data.ids
        let link = document.createElement('a');
        link.style.display = 'none';
        link.href = url;
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
    },
}